<template>
    <div>
        <h1>hellow!</h1>
        <h2>count:{{ count}}</h2>
        <button @click="chc">修改count</button>
    </div>
</template>


<style scoped>
    .sh1{
        color: #000;
        margin: 30px,0;
        height: 70px,0;
    }
</style>

<script lang="ts" setup>
    import {ref,watch} from 'vue'
    let count =ref(1)

    function chc(){
        count.value +=1
    }

    watch(count,(newc,oldc)=>{
        console.log('count变了',newc,oldc)
    })
</script>